package com.oracle.user.contrller;


import com.oracle.user.entity.ChargeEntity;
import com.oracle.user.service.ChargeService;
import com.oracle.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.Map;



/**
 *
 *
 * @author oracle
 * @email 2878992612@qq.com
 * @date 2024-10-31 09:37:51
 */
@RestController
@RequestMapping("user/charge")
public class ChargeController {
    @Autowired
    private ChargeService chargeService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params){
//        PageUtils page = chargeService.queryPage(params);

        return R.ok();
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Integer id){
		ChargeEntity charge = chargeService.getById(id);

        return R.ok();
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody ChargeEntity charge){
		chargeService.save(charge);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody ChargeEntity charge){
		chargeService.updateById(charge);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] ids){
		chargeService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
